package com.example.skillcinema.db.apis

import okhttp3.OkHttpClient
import retrofit2.Retrofit
import retrofit2.converter.moshi.MoshiConverterFactory

internal val API: String = "77a9571c-1387-433c-8922-561c480d53ae"
val BASE_URL = "https://kinopoiskapiunofficial.tech/api/"

object RetrofitService {
    private val okHttpClient: OkHttpClient =
        OkHttpClient.Builder().addInterceptor(ApiKeyInterceptor()).build()
    private val retrofit: Retrofit =
        Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(MoshiConverterFactory.create())
            .client(okHttpClient).build()

    val filmsApi: FilmsApi = retrofit.create(FilmsApi::class.java)
    val premierApi: PremierApi = retrofit.create(PremierApi::class.java)
}